// 规章制度
import { stringify } from 'qs';
import request from '@/utils/request';

// 规章制度列表
export function getList(params) {
    return request(`/api/oa/v1/institutions?${stringify(params)}`, {
        method: 'GET'
    });
}

// 规章制度列表
export function getInstitutions(params) {
    return request(`/api/oa/v1/institutions/getDetail/${params.id}`, {
        method: 'GET'
    });
}

// 获取职级详情中的制度详情
export function getRankInstitution() {
    return request('/api/oa/v2/rank/institution', {
        method: 'GET'
    });
}

// 规章制度列表
export function changeInstitutions(params) {
    return request(`/api/oa/v1/institutions/updateInstitutions/${params.id}`, {
        method: 'PATCH',
        data: params
    });
}

/**
 * 发起规章制度申请
 * @method GET
 */
export async function featchApply(params) {
    return request(`/api/oa/v1/institutions/apply/${params.companyId}`, {
        method: 'GET'
    });
}
